home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / dbms_mag / 9103 / techtip2.mar < prev    next >
Text File  |  1991-01-30  |  693b  |  28 lines

  1.  
  2. /****************************************************
  3. *
  4. *   STRREP -- replace a char in a string
  5. *   strrep (str, pos, ch) is the same as the C line
  6. *           str [pos]=ch ;
  7. *   except that Clipper numbers arrays from 1, not 0.
  8. *   
  9. *   In order for this to link properly, you need to
  10. *   compile with the -N- switch. This prevents
  11. *   Turbo C from checking thhe stack for overflow:
  12. *          tcc -c -N- -ml strrep
  13. *
  14. *****************************************************
  15.  
  16. #include <nandef.h>
  17. #include <extend.h>
  18.  
  19. CLIPPER strrep (void)
  20. {
  21.     char *str = _parc (1) ;
  22.     int   pos = _parni(2) ;
  23.     char *rep = _parc (3) ;
  24.  
  25.     str[pos-1] = *rep ;
  26.     _ret() ;
  27. }
  28.